<?php

namespace app\common\model;

use think\Model;

class Inform extends Model
{
    // 表名
    protected $name = 'inform';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    
    // 追加属性
    protected $append = [
        'typelist_text'
    ];
    

    
    public function getTypelistList()
    {
        return ['0' => __('Typelist 0'),'1' => __('Typelist 1')];
    }     


    public function getTypelistTextAttr($value, $data)
    {        
        $value = $value ? $value : $data['typelist'];
        $list = $this->getTypelistList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
